import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;

public class DemoMIDlet extends MIDlet
{
	
	#include "defines.h"
	
	static DemoMIDlet _theMIDlet = null;
	static private cGame mCanvas = null;
	static Display s_display;

	public DemoMIDlet()
	{
		_theMIDlet = this;
	}
	
	protected void startApp()
	{
		if (mCanvas == null)
		{
			mCanvas = new cGame();
			mCanvas.setFullScreenMode(true);
			Display.getDisplay(this).setCurrent(mCanvas);
		}
		 // if (s_display == null)
            // {
                // s_display = Display.getDisplay(this);
            // }

            // if (mCanvas == null)
            // {
                // mCanvas = new cGame();
                // cGame.s_midlet = this ;
                // s_display.setCurrent(mCanvas);
                // new Thread(mCanvas).start();
            // }
            // else
            // {
                // s_display.setCurrent(mCanvas);
            // }
	}

	protected void pauseApp()
	{
	}

	protected void destroyApp(boolean arg0)
	{
		// if(cGame.node==null || cGame.node.isEmpty())
			// cGame.showContinue=false;
		// else
			// cGame.showContinue=true;
		// cGame.setSaveGame();
		// cGame.saveRS(false);
		notifyDestroyed ();
	}
}
